package com.chenfan.mcn.model.vo;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.chenfan.mcn.enums.ApprovalStatusEnum;
import com.chenfan.mcn.enums.ArchivingStatusEnum;
import com.chenfan.mcn.model.PurchaseContract;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.Objects;

/**
 * @Author liuyang
 * @Date 2021/2/27
 * @Time 13:55
 * @Version V1.0
 **/
@EqualsAndHashCode(callSuper = true)
@Data
public class PurchaseContractVO extends PurchaseContract {

    /**
     * 流程id
     */
    private Long flowId;

    /**
     * 审批流程全部节点
     */
    private String flowIds;

    /**
     * 流程节点名称
     */
    private String flowStatusName;

    /**
     * 单据状态名称
     */
    private String purchaseStatusName;

    public String getPurchaseStatusName() {
        if (Objects.nonNull(getPurchaseStatus())) {
            return ApprovalStatusEnum.getStatusName(getPurchaseStatus());
        }
        return null;
    }

    /**
     * 归档状态名称
     */
    private String archivingStatusName;

    public String getArchivingStatusName() {
        if (Objects.nonNull(getArchivingStatus())) {
            return ArchivingStatusEnum.getStatusName(getArchivingStatus());
        }
        return null;
    }

    /**
     * 执行单列表
     */
    Page<ChooseExecution> chooseExecutionIpage;
}
